package com.sy.jtamqproducer.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sy.jtamqproducer.pojo.TestS2;
import com.sy.jtamqproducer.service.TestService;

@Controller
public class ProducerController {
	
	@Autowired
	private TestService testService;
	
	@GetMapping("test")
    @ResponseBody
	public String jIndex(Model model) {
		TestS2 test = testService.getTest(1);
		return "调用成功";
	}
	
	@GetMapping("save")
	@ResponseBody
	public String save(Model model) {
		TestS2 test = new TestS2();
		test.setName("jtamqtest");
		testService.saveTest(test);
		return "调用成功";
	}
}
